<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="../bootstrap-5.1.3-dist/css/bootstrap.css" rel="stylesheet">
    <script src="../bootstrap-5.1.3-dist/js/bootstrap.bundle.min.js"></script>
</head>

<body class="container">
    <h2 align="center">定义折叠</h2>
    <p>
        <a class="btn btn-primary" data-bs-toggle="collapse" href="#collapse">&lt; a &gt;触发折叠</a>
        <button class="btn btn-danger" type="button" data-bs-toggle="collapse" data-bs-target="#collapse1">&lt; button
            &gt;触发折叠</button>
    </p>
    <div class="collapsing" id="collapse">
        <div class="card card-body">
            这是&lt; a &gt;触发的折叠内容
        </div>
    </div>
    <div class="collapse" id="collapse1">
        <div class="card card-body">
            这是&lt; button &gt;触发的折叠内容
        </div>
    </div>

</body>

</html>